﻿using System.Web.UI;

namespace Eneta.Portal.Forum.Common.Controls
{
    public class OWSBooleanField : OWSBase
    {
        // Methods
        protected override void Render(HtmlTextWriter wtr)
        {
            wtr.Write("<SCRIPT>fld = new BooleanField(frm, \"{0}\", \"{1}\", \"{2}\"); fld.IMEMode=\"inactive\"; fld.BuildUI();</SCRIPT>", new object[] { this.UniqueID, base.Display, base.JavaScriptValue, base.Required.ToString().ToLower() });
            wtr.Write("&nbsp;<br><SPAN class=ms-formdescription ID={0}>{1}</SPAN>", this.UniqueID, this.Description);
        }

        // Properties
        public override string Text
        {
            get
            {
                if (!(this.Value == "1"))
                {
                    return "No";
                }
                return "Yes";
            }
        }
    }
}
